﻿#region Header

/*
    This file is part of nDoctor Light

    NDoctor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    NDoctor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with NDoctor.  If not, see <http://www.gnu.org/licenses/>.
*/

#endregion Header

namespace Probel.Ldoc.Services.Dto
{
    #region Enumerations

    public enum Status
    {
        Warn,
        Error,
        Info,
    }

    #endregion Enumerations

    /// <summary>
    /// Represents a status that should be showed to the user.
    /// </summary>
    public class UiMessageDto
    {
        #region Constructors

        private UiMessageDto(Status status, string message)
        {
            this.Status = status;
            this.Message = message;
        }

        #endregion Constructors

        #region Properties

        /// <summary>
        /// Gets or sets the message to be displayed.
        /// </summary>
        /// <value>
        /// The message.
        /// </value>
        public string Message
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the status of the message (Info, Warn or Error).
        /// </summary>
        /// <value>
        /// The image.
        /// </value>
        public Status Status
        {
            get;
            set;
        }

        #endregion Properties

        #region Methods

        public static UiMessageDto Error(string message)
        {
            return new UiMessageDto(Status.Error, message);
        }

        public static UiMessageDto Info(string message)
        {
            return new UiMessageDto(Status.Info, message);
        }

        public static UiMessageDto Warn(string message)
        {
            return new UiMessageDto(Status.Warn, message);
        }

        #endregion Methods
    }
}